﻿using ModelLayer;
using System.Collections.Generic;

namespace DataAccessObjectLayer
{
    public interface IDBStation
    {
        /// <summary>
        /// Gets all stations from the database.
        /// </summary>
        /// <returns>List{Station}.</returns>
        List<Station> GetAllStations();

        /// <summary>
        /// Gets a station from the database
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns>Station.</returns>
        Station GetStation(long id);

        /// <summary>
        /// Inserts a station in the database.
        /// </summary>
        /// <param name="station">The station.</param>
        /// <returns>The number of affected rows</returns>
        int InsertStation(Station station);

        /// <summary>
        /// Updates a station in the database
        /// </summary>
        /// <param name="station">The station.</param>
        /// <returns>The number of affected rows</returns>
        int UpdateStation(Station station);

        /// <summary>
        /// Removes a station from the database.
        /// </summary>
        /// <param name="stationId">The station identifier.</param>
        /// <returns>The number of affected rows</returns>
        int RemoveStation(long stationId);

        /// <summary>
        /// Removes a battery from a list of stations in the database.
        /// </summary>
        /// <param name="stationList">The station list.</param>
        /// <returns><c>true</c> if the batteries were subtracted, <c>false</c> otherwise.</returns>
        /// <exception cref="System.Exception">No Batteries on station + tmpStation.Name</exception>
        bool RemoveBatteries(List<Station> stationList);
    }
}